<template>
  <el-table
    :data="tableData"
    style="width: 100%">
    <el-table-column
      label="Sku名称"
>
      <template slot-scope="scope">
      
        <span style="margin-left: 10px">{{ scope.row.commodSpeciName }}</span>
      </template>
    </el-table-column>
    <el-table-column
      label="Sku规格"
>
      <template slot-scope="scope">
        <el-popover trigger="hover" placement="top">
          <p>分类: {{ scope.row.commodSpeciName }}</p>
          <p>规格: {{ scope.row.commodSmallName }}</p>
          <div slot="reference" class="name-wrapper">
            <el-tag size="medium">{{ scope.row.commodSmallName }}</el-tag>
          </div>
        </el-popover>
      </template>
    </el-table-column>
    <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button
          size="mini"
          @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
        <el-button
          size="mini"
          type="danger"
          @click="handleDelete(scope.$index, scope.row)">删除</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
  export default {
    data() {
      return {
        tableData: []
      }
    },
	mounted(){
          this.getlist();
	},
    methods: {
	  getlist(){
       this.axios.get("https://localhost:44338/api/app/sku/sku")
	   .then((r)=>{
		  
		   this.tableData=r.data.items
		    console.log(this.tableData)
	   })
	  },
      handleEdit(index, row) {
		  alert(row.id),
        console.log(index, row);
      },
      handleDelete(index, row) {
		   alert(row.id),
        console.log(index, row);
      }
    }
  }
  //https://localhost:44338/api/app/sku/sku?Id
</script>